<%@ page import="java.util.List" %>
<%@ page import="com.hui.bean.ClassBean" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>班级管理-宿管系统</title>
    <link rel="stylesheet" href="../../css/basicLayout.css">
</head>
<body>

<!--    头部，用来放导航栏-->
<div id="header">
    <ul>
        <li><a href="/student/index"> 学生管理</a></li>
        <li><a href="/class/index"> 班级管理</a></li>
        <li><a href="/room/index"> 房间管理</a></li>
    </ul>
</div>

<!--子导航栏区域-->
<div id="child">
    <label>班级管理功能</label>
    <ul>

        <li><a href="/class/add/index">添加班级</a></li>
    </ul>
</div>

<!--主体内容区域-->
<div id="content">
    <div id="show">
        <table id="showTable">
            <tr>
                <th>班级名称</th>
                <th>开版时间</th>
                <th>带班老师</th>
                <th></th>
            </tr>
            <c:forEach items="${classList}" var="cb">
                <tr>
                    <td>${cb.className}</td>
                    <td>${cb.foundDate}</td>
                    <td>${cb.teacherName}</td>
                    <td><a href="${pageContext.request.contextPath}/class/delete/execute?classId=${cb.classId}">删除</a></td>
                </tr>
            </c:forEach>

<%--            <%--%>
<%--                List<ClassBean> allClasses = (List<ClassBean>) request.getAttribute("classList");--%>
<%--                for (ClassBean cb : allClasses) {--%>
<%--                    out.println("<tr>");--%>
<%--                    out.println("<td>"+cb.getClassName()+"</td>");--%>
<%--                    out.println("<td>"+cb.getFoundDate()+"</td>");--%>
<%--                    out.println("<td>"+cb.getTeacherName()+"</td>");--%>
<%--                    out.println("<td><a href=\"/deleteClass?classId="+cb.getClassId()+"\">删除</a></td>");--%>
<%--                    out.println("</tr>");--%>
<%--                }--%>
<%--            %>--%>
        </table>


        <form action="${pageContext.request.contextPath}/class/index" method="post">
            <input type="hidden" name="currentPage" value="${page.currentPage}">
            <span>第${page.currentPage}页</span><span>共${page.totalPage}页</span>
            <input type="submit" name="operation" class="layui-btn layui-btn-primary" value="首页">
            <input type="submit" name="operation" class="layui-btn layui-btn-primary" value="上一页">
            <input type="submit" name="operation" class="layui-btn layui-btn-primary" value="下一页">
            <input type="submit" name="operation" class="layui-btn layui-btn-primary" value="尾页">
        </form>
    </div>
</div>

<!--页脚内容区域-->
<div id="footer">页脚</div>
</body>
</html>
